﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class ResizableBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private Resizable Resizable
        {
            get
            {
                return this.Component as Resizable;
            }
        }


        public ResizableBuilder()
            : base(new Resizable())
        {

        }

        public ResizableBuilder(Resizable Resizable)
            : base(Resizable)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public ResizableBuilder Set(string property, object value)
        {
            if (this.Resizable.Properties.ContainsKey(property))
            {
                this.Resizable.Properties[property] = value;
            }
            else
            {
                this.Resizable.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerResizable的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public ResizableBuilder Manager(string manager)
        {
            this.Resizable.Manager = manager;
            return this;
        }


        public ResizableBuilder Handles(string value)
        {
            this.Resizable.Handles = value;
            return this;
        }
        public ResizableBuilder MaxWidth(int value)
        {
            this.Resizable.MaxWidth = value;
            return this;
        }
        public ResizableBuilder MaxHeight(int value)
        {
            this.Resizable.MaxHeight = value;
            return this;
        }
        public ResizableBuilder MinWidth(int value)
        {
            this.Resizable.MinWidth = value;
            return this;
        }
        public ResizableBuilder MinHeight(int value)
        {
            this.Resizable.MinHeight = value;
            return this;
        }
        public ResizableBuilder Scope(int value)
        {
            this.Resizable.Scope = value;
            return this;
        }
        public ResizableBuilder Animate(bool value)
        {
            this.Resizable.Animate = value;
            return this;
        }
    }
}